package com.qfedu.controller;

import com.qfedu.pojo.Clinicpatient;
import com.qfedu.service.ClinicpatientService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Controller
public class ClinicpatientController {
    @Resource
    private ClinicpatientService clinicpatientService;
//根据pid查询患者信息
    @GetMapping("getClinicpatientByPid")
    public Clinicpatient getClinicpatientByPid(int pid){

        return clinicpatientService.getClinicpatientByPid(pid);
    }
//根据查出来的pid整条信息进行更新数据
    @PostMapping("updateClinicpatient")
    public Clinicpatient updateClinicpatient(Clinicpatient clinicpatient){
        return clinicpatientService.updateClinicpatient(clinicpatient);
    }
//    新增患者信息(部分字段)
    @PostMapping("saveClinicpatient")
    @ResponseBody
    public boolean saveClinicpatient(@RequestBody Clinicpatient c){
        System.out.println(c);
        return clinicpatientService.saveClinicpatient(c)>0;
    }
}




